package com.wz.wiki.controller;

import com.wz.wiki.entity.pojo.Test;
import com.wz.wiki.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 王哲
 * @Contact 1121586359@qq.com
 * @ClassName TestController.java
 * @create 2023年06月27日 下午10:02
 * @Description 测试接口
 * @Version V1.0
 */
@RestController
public class TestController {

    @Autowired
    private TestService testService;

    @GetMapping("/test")
    public String test() {
        return "Hello World!";
    }

    @PostMapping("/hello")
    public String hello() {
        return "Hello World!";
    }

    @PostMapping("/hello/post")
    public String helloC(@RequestParam Integer id) {
        return "Hello World!"+id;
    }

    @GetMapping("/getTestList")
    public List<Test> getTestList() {
        return testService.selectList();
    }

}
